﻿@model SolidDemo.Models.Select.PumpModel

@{
    ViewBag.Title = "Select Pump";
}

@section scripts{
    <style>
      label {
          width: 200px;
      }  
    </style>
}

@using (Html.BeginForm())
{
    <h2>Select Pump</h2>

    @Html.EditorFor(m=>m.IsStocked)
    @Html.EditorFor(m => m.DiameterMm)
    @Html.EditorFor(m => m.MinFlowLperMin)
    @Html.EditorFor(m => m.MaxFlowLPerMin)

    <div class="spacer">
        <input type="submit" value="GO"/>
    </div>
    
    if (Model.IsShowResults)
    {
        <table class="table-striped" style="width:100%">
            <tr>
                <th>Code</th>
                <th>Description</th>
                <th>Diameter (mm)</th>
                <th>Min Flow (L per min)</th>
                <th>Max Flow (l per min)</th>
                <th>Efficiency %</th>
                <th>Price $</th>
            </tr>
            @foreach (var pump in Model.Pumps)
            {
                <tr>
                    <td>@pump.Code</td>
                    <td>@pump.Description</td>
                    <td>@pump.DiameterMm</td>
                    <td>@pump.MinFlowLPerMin</td>
                    <td>@pump.MaxFlowLPerMin</td>
                    <td>@pump.EfficiencyPercent</td>
                    <td>@pump.RetailPrice</td>
                </tr>
            }
        </table>
    }
}